/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
 * Description: 算子tiling的接口文件
 * Author: qingjicheng
 * Create: 2020-12-1
 */

#ifndef OPS_BUILT_IN_OP_TILING_VECTOR_TILING_H
#define OPS_BUILT_IN_OP_TILING_VECTOR_TILING_H

#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "elewise_memset.h"
#include "eletwise_v1.h"
#include "op_tiling.h"
#include "eletwise_v2.h"
#include "eletwise_v3.h"
#include "exe_graph/runtime/tiling_context.h"
#include "exe_graph/runtime/tiling_parse_context.h"
#include "auto_tiling_rt2.h"

namespace TbeReduce {

/*
 * @brief: tiling function of elementwise operator
 * @param [in] opType_: opType_ of the elementwise operator
 * @param [in] opParas_: inputs/outputs/atts of the elementwise operator
 * @param [in] opInfo_: compile time generated info of the elementwise operator
 * @param [out] runInfo: result data
 * @return bool: success or not
 */
bool EletwiseTilingV1(const std::string& opType_, const TeOpParas& opParas_, const nlohmann::json& opInfo_,
    OpRunInfo& runInfo);

/*
 * @brief: tiling function of reduce operator
 * @param [in] opType_: opType_ of the reduce operator
 * @param [in] opParas_: inputs/outputs/atts of the reduce operator
 * @param [in] opInfo_: compile time generated info of the reduce operator
 * @param [out] runInfo: result data
 * @return bool: success or not
 */
/* int8类型的算子与其他算子开发时间不同，与老的tiling逻辑不匹配，该函数为新的tiling接口 */
bool EletwiseTilingV2(const std::string& opType, const TeOpParas& opParas, const nlohmann::json& opInfo,
    OpRunInfo& runInfo);

/* 910* tbe的算子与其他算子开发时间不同，与老的tiling逻辑不匹配，该函数为新的tiling接口 */
bool EletwiseTilingV3(const std::string& opType, const TeOpParas& opParas, const nlohmann::json& opTilingInfo,
    OpRunInfo& runInfo);

bool MemSetTiling(const std::string& op_type, std::vector<int64_t>& sizes, const MemSetCompileInfo& compile_info,
    OpRunInfo& run_info);
ge::graphStatus AutoTiling(gert::TilingContext* context);
ge::graphStatus AutoTilingParser(gert::TilingParseContext *context);
}  // namespace TbeReduce
#endif  // OPS_BUILT_IN_OP_TILING_VECTOR_TILING_H
